Display data obtaining method, electronic device and storage medium

ABSTRACT

A method is provided for obtaining display data. The method includes: obtaining rendering data corresponding to an application program surface; obtaining, in response to detecting an operation of adjusting a dimension of the application program surface, a transformation coefficient corresponding to the application program surface, where the transformation coefficient is a scale value between a dimension of the application program surface after adjustment and a dimension before adjustment; and obtaining display data of a corresponding masking layer of the application program surface according to the transformation coefficient and the rendering data.

CROSS REFERENCE TO RELATED APPLICATION

The present application is based on and claims priority to ChinesePatent Application No. 202110886640.7, filed on Aug. 3, 2021, the entirecontents of which are incorporated herein by reference for all purposes.

BACKGROUND

Currently, an Android system supports a multi-window function, and auser may invoke an application program according to practicalrequirements. When the application program is started, a dimension of anapplication program window is an initial dimension. When the user needsto adjust the dimension of the application program window, the user mayadjust the initial dimension to a target dimension by dragging thewindow. When the dimension of the window is adjusted, a layer may beadded to an original layer of the Android system, the newly added layerserves as a masking layer, and a lower layer serves a masked layer, thusimproving a special effect of masking.

In practical application, when masking is added, the Android system mayload a picture through View or display different surfaces to realize amasking function, which needs to rely on a System Server process in theAndroid system. However, considering that the System Server processinvolves inter-process communication in an adding course, the course istime-consuming and prone to causing a phenomenon of display frame loss,so a viewing experience is affected.

SUMMARY

The present disclosure relates, but not limited, to the technical fieldof display technology, and more particularly, to a method and anapparatus for obtaining display data, an electronic device, and anon-transitory computer readable storage medium thereof

According to a first aspect of the disclosure, a display data obtainingmethod is provided, and the method includes: obtaining rendering datacorresponding to an application program surface; obtaining, in responseto detecting an operation of adjusting a dimension of the applicationprogram surface, a transformation coefficient corresponding to theapplication program surface; and obtaining display data of acorresponding masking layer of the application program surface accordingto the transformation coefficient and the rendering data.

According to a second aspect of the disclosure, an electronic device isprovided, and includes: a processor; and a memory used to store acomputer program executable by the processor. The processor isconfigured to execute the computer program in the memory, so as toimplement the method according to the first aspect of the disclosure.

According to a third aspect of the disclosure, a non-transitory computerreadable storage medium is provided. The non-transitory computerreadable storage medium stores a plurality of programs for execution byan electronic device having one or more processors, wherein theplurality of programs, when executed by the one or more processors,cause the electronic device to implement the method according to thefirst aspect of the disclosure.

It should be understood that the above general description and thefollowing detailed description are merely examples and illustrative, andcannot limit the disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate examples consistent with thedisclosure and together with the specification serve to explain theprinciples of the disclosure.

FIG. 1 is a flow chart of a display data obtaining method illustratedaccording to an example.

FIG. 2 is a schematic diagram of an effect of a page bar on a right pagedisplay position when display is performed in columns illustratedaccording to an example.

FIG. 3 is a flow chart of obtaining rendering data illustrated accordingto an example.

FIG. 4 is a schematic diagram of an initial surface of an applicationprogram surface illustrated according to an example.

FIG. 5 is a schematic diagram of masking by dragging an applicationprogram surface to a target surface illustrated according to an example.

FIG. 6 is a block diagram of a display data obtaining apparatusillustrated according to an example.

FIG. 7 is a block diagram of an electronic device illustrated accordingto an example.

DETAILED DESCRIPTION

Examples will be explained in detail herein and are illustrated in theaccompanying drawings. When the following description refers to theaccompanying drawings, the same numbers in different drawings representthe same or similar elements unless otherwise indicated. The examplesdescribed below do not represent all examples consistent with thedisclosure. On the contrary, they are merely examples of an apparatusand a method consistent with some aspects of the disclosure as detailedin the appended claims. It should be noted that, in the case of noconflict, the following examples and features in the implementations canbe combined with each other.

Reference throughout this specification to “one embodiment,” “anembodiment,” “an example,” “some embodiments,” “some examples,” orsimilar language means that a particular feature, structure, orcharacteristic described is included in at least one embodiment orexample. Features, structures, elements, or characteristics described inconnection with one or some embodiments are also applicable to otherembodiments, unless expressly specified otherwise.

The terms “module,” “sub-module,” “circuit,” “sub-circuit,” “circuitry,”“sub-circuitry,” “unit,” or “sub-unit” may include memory (shared,dedicated, or group) that stores code or instructions that can beexecuted by one or more processors. A module may include one or morecircuits with or without stored code or instructions. The module orcircuit may include one or more components that are directly orindirectly connected. These components may or may not be physicallyattached to, or located adjacent to, one another.

In order to solve the above technical problems, an example of thedisclosure provides a display data obtaining method. FIG. 1 is a flowchart of a display data obtaining method illustrated according to anexample. The method may be applied to electronic devices, such as asmart phone, a smart bracelet, a tablet computer, a personal computer, asmart television and other devices. An Android system and an applicationprogram (APP) may be installed in the electronic devices. With referenceto FIG. 1 , the display data obtaining method includes step 11 to step13.

In step 11, rendering data corresponding to an application programsurface are obtained.

In the example, in a display course, an electronic device may detectoperations by a user on a display screen of the electronic device inreal time or according to a set cycle. The above operations may includebut are not limited to: click, double-click, dragging, long press, etc.When an operation of triggering the application program surface (such asa starting moment of dragging) by the user is detected, the electronicdevice may obtain the rendering data corresponding to the applicationprogram surface in response to detecting the operation of triggering theapplication program surface.

With reference to FIG. 2 , in step 21, the electronic device may obtainsurface data corresponding to the application program surface. When theapplication program on the electronic device is started, a correspondingsurface of the application program surface is an initial surface, and adimension of the initial surface is a first dimension. The surface datamay include at least one of: a corresponding image (such as a last frameof image displayed) upon detecting the operation of triggering theapplication program surface, an image pre-stored locally and an imageset in an application program (such as an icon of the applicationprogram). Suitable surface data may be selected based on a specificscenario, and under a condition that display data of a masking layer canbe generated, corresponding solutions fall into the protective scope ofthe disclosure.

It needs to be noted that, in an example, in step 21, when the operationof triggering the application program surface is detected, a buffer-typeSurfaceControl module will be simultaneously created, the SurfaceControlmodule includes a buffer, and the buffer is a target buffer insubsequent step 23.

In step 22, the electronic device may obtain the rendering data byrendering the surface data. It can be understood that, for a course ofimage rendering, reference may be made to the related art, andrepetition is not made here. In an example, the rendering data areobtained by rendering the surface data through an interface API providedby a 2D hardware drawing module HWUI in the Android system, and theobtained rendering data are stored in a buffer corresponding to the 2Dhardware drawing module HWUI.

In step 23, the electronic device may store the rendering data to thetarget buffer; and the target buffer is created upon detecting theoperation of triggering the application program surface. In the example,the electronic device may bind rendering data drawn by the 2D hardwaredrawing module HWUI to the target buffer, such that an effect of storingthe rendering data to the buffer in the SurfaceControl module isachieved.

In step 12, a transformation coefficient corresponding to theapplication program surface is obtained in response to detecting theoperation of adjusting the dimension of the application program surface.

In the example, the transformation coefficient may include at least oneof: a scale coefficient, a rotation angle and an offset distance. Atechnician may select a suitable transformation system according to thespecific scenario, which is not limited here. To take the transformationcoefficient being the scale coefficient as an example, the scalecoefficient is a scale value between a dimension of the applicationprogram surface after adjustment and a dimension before adjustment. Thesolution is described by taking the scale coefficient as an example insubsequent examples.

In the example, the electronic device may continue to detect theoperations by the user on the display screen of the electronic device inreal time or according to the set cycle. The above operations mayinclude but are not limited to: click, double-click, dragging, longpress, etc. With reference to FIG. 3 , in step 31, when it is detectedthat the operation of triggering the application program surface by theuser (such as a middle moment or an ending moment after the startingmoment of dragging) is adjusting the dimension of the applicationprogram surface, the electronic device may obtain the first dimension ofthe initial surface corresponding to the application program in responseto detecting the operation of triggering the application programsurface, such as the first dimension of the initial surface 41 in FIG. 4: a width W1 and a height H1. The initial surface 41 is generated whenstarting the application program in step 21. In step 32, the electronicdevice may obtain a second dimension of a target surface correspondingto the adjusted initial surface. For example, the initial surface 41 isamplified to the target surface 43 in a direction shown by v to obtainthe second dimension of the target surface in FIG. 5 : a width W2 and aheight H2. In step 33, the electronic device may obtain a scale valuebetween the second dimension and the first dimension, such as a widthscale value W=W2/W1 or a height scale value H=H2/H1, and set the abovescale value as the transformation coefficient corresponding to theapplication program surface.

In step 13, the display data of the corresponding masking layer of theapplication program surface are obtained according to the transformationcoefficient and the rendering data.

In the example, the electronic may obtain the display data of thecorresponding masking layer of the application program surface accordingto the transformation coefficient and the rendering data. In an example,a display module in the electronic device may process the transformationcoefficient and the rendering data, i.e. zoom the above rendering dataaccording to the above transformation coefficient to obtain the displaydata. The display data are used for the corresponding masking layer ofthe application program surface, and the masking layer shown in FIG. 5is finally formed, i.e. the image set in the application program, thatis the icon of the application program, is displayed in the maskinglayer.

It needs to be noted that, in a course of zooming the above renderingdata, the rendering data may be processed by adopting a preset filteringmethod (such as Gaussian Blur). Under a condition that processing of therendering data can be implemented, corresponding solutions fall into theprotective scope of the disclosure.

It further needs to be noted that, the above examples only describe thesolution of adjusting a size of the masking layer. In practicalapplication, transformation operations such as offset, rotation and thelike may further be performed on masking, and corresponding solutionsfall into the protective scope of the disclosure.

So far, in the solutions provided by the examples of the disclosure, therendering data corresponding to the application program surface may beobtained upon detecting the operation of triggering the applicationprogram surface; then the transformation coefficient corresponding tothe application program surface may be obtained in response to detectingthe operation of adjusting the dimension of the application programsurface, the transformation coefficient being the scale value betweenthe dimension of the application program surface after adjustment andthe dimension before adjustment; and then the display data of thecorresponding masking layer of the application program surface areobtained according to the transformation coefficient and the renderingdata. In this way, in the examples, the display data are obtained byadjusting the rendering data through the transformation coefficient,i.e. inter-process communication is not needed and communication timeconsumption can be reduced, which is conducive to avoiding or mitigatinga phenomenon of display frame loss and improving a viewing experience.

Superiorities of the display data obtaining method provided by theexample are described below in combination with an operation system ofthe electronic device.

A solution of adding a masking layer in the related art

Step 1: a user starts an application program (APP), and at the moment, adimension of an application program surface is 3×3 cm. A SystemServermodule in the operation system obtains the above dimension 3×3 cm.

Step 2: the user drags the above application program surface andamplifies it to a 6×6 cm target surface. A SystemServer module in theoperation system obtains a dimension of the target surface, and sends itto the application program. At the moment, the application programrequests the system to create a buffer with a dimension of 6×6 cm, andthe buffer may contain the following information: a picture, such as anRGB value, a text, and pixel point information. A masking layer isre-drawn on the buffer.

Step 3: a Display module of the system obtains buffer data provided bystep 2 and performs display.

A solution of adding a masking layer in the example is a display dataobtaining method.

Step 1: the user starts the application program (APP), and at themoment, the dimension of the application program surface is 3×3 cm. ASystemServer module in the operation system obtains the above dimension3×3 cm. At the moment, the buffer-type SurfaceControl module is created,and the size of the masking layer is 3×3 cm. The buffer may contain thefollowing information: a picture, such as an RGB value, a text, andpixel point information. A masking layer is re-drawn on the buffer.

Step 2: the user drags the above application program surface andamplifies it to a 6×6 cm target surface. A SystemServer module in theoperation system obtains a dimension 6×6 cm of the target surface, andthe SystemServer module obtains a scale value 200% between a length anda width, i.e. obtain the transformation coefficient corresponding to themasking layer.

Step 3: the SystemServer module sends the above transformationcoefficient 200% to the 2D hardware drawing module HWUI, and the 2Dhardware drawing module HWUI sets a zooming coefficient. At the moment,the rendering data in the buffer are not changed.

Step 4: a Display module of the system obtains buffer data and thetransformation coefficient provided by step 2 to perform zoomingprocessing, and uses processed display data to perform display.

In contrastive analysis, compared with the solution in the related art,in the solution provided by the examples of the disclosure, only onebuffer needs to be created, and the size of the masking layer is changedthrough the transformation coefficient. A new buffer does not need to becreated every time the dimension of the application program is zoomed,so reliance on the SystemServer module in the operation system may bereduced, which may reduce time consumption and is conducive tomitigating a phenomenon of frame loss.

On the basis of the display data obtaining method provided by theexample of the disclosure, an example further provides a display dataobtaining apparatus. With reference to FIG. 6 , the apparatus includes:

a rendering data obtaining module 61, configured to obtain renderingdata corresponding to an application program surface;

a transformation coefficient obtaining module 62, configured to obtain,in response to detecting an operation of adjusting a dimension of theapplication program surface, a transformation coefficient correspondingto the application program surface; and

a display data obtaining module 63, configured to obtain display data ofa corresponding masking layer of the application program surfaceaccording to the transformation coefficient and the rendering data.

Alternatively, the rendering data obtaining module includes:

a surface data obtaining unit, configured to obtain surface datacorresponding to the application program surface;

a rendering data obtaining unit, configured to obtain the rendering databy rendering the surface data; and

a rendering data storing unit, configured to store the rendering data toa target buffer. The target buffer is created upon detecting anoperation of triggering the application program surface.

Alternatively, the surface data include at least one of: a correspondingimage upon detecting the operation of triggering the application programsurface, an image pre-stored locally and/or an image set in anapplication program.

Alternatively, the transformation coefficient includes at least one of:a scale coefficient, a rotation angle and/or an offset distance.

Alternatively, the transformation coefficient obtaining module includes:

a first dimension obtaining unit, configured to obtain a first dimensionof an initial surface corresponding to the application program;

a second dimension obtaining unit, configured to obtain a seconddimension of a target surface corresponding to the adjusted initialsurface; and

a transformation coefficient obtaining unit, configured to obtain ascale value between the second dimension and the first dimension, andset the scale value as the transformation coefficient corresponding tothe application program surface.

It needs to be noted that, contents of the apparatus illustrated in theexample are matched with contents of the method example illustrated inFIG. 1 . Reference may be made to the contents of the above methodexample, and repetition is not made here.

FIG. 7 is a block diagram of an electronic device illustrated accordingto an example. For example, the electronic device 700 may be a smartphone, a computer, a digital broadcasting terminal, a tablet device, amedical device, a fitness device, a personal digital assistant, etc.

With reference to FIG. 7 , the electronic device 700 may include one ora plurality of the following components: a processing component 702, amemory 704, a power supply component 706, a multimedia component 708, anaudio component 710, an input/output (I/O) interface 712, a sensorcomponent 714, a communication component 716, and an image acquisitioncomponent 718.

The processing component 702 generally controls overall operations ofthe electronic device 700, such as operations associated with display,telephone calls, data communications, camera operations, and recordingoperations. The processing component 702 may include one or a pluralityof processors 720 to execute a computer program. In addition, theprocessing component 702 may include one or a plurality of modules tofacilitate interaction between the processing component 702 and othercomponents. For example, the processing component 702 may include amultimedia module to facilitate interaction between the multimediacomponent 708 and the processing component 702.

The memory 704 is configured to store various types of data to supportthe operations of the electronic device 700. Examples of these datainclude any application program or computer programs for methodoperating on the electronic device 700, contact data, phone book data,messages, pictures, videos, etc. The memory 704 may be implemented byany type of volatile or non-volatile storage device or theircombination, such as a static random access memory (SRAM), anelectrically erasable programmable read-only memory (EEPROM), anerasable programmable read-only memory (EPROM), a programmable read-onlymemory (PROM), a read-only memory (ROM), a magnetic memory, a flashmemory, a magnetic disk or an optical disk.

The power supply component 706 provides power for various components ofthe electronic device 700. The power supply component 706 may include apower management system, one or a plurality of power supplies, and othercomponents associated with the generation, management, and distributionof power for the electronic device 700. The power supply component 706may include a power supply chip, and a controller may communicate withthe power supply chip to control the power supply chip to turn on or offa switching device, so that a battery supplies or does not supply powerto a main board circuit.

The multimedia component 708 includes a screen that provides an outputinterface between the electronic device 700 and a target object. In someexamples, the screen may include a liquid crystal display (LCD) and atouch panel (TP). If the screen includes the touch panel, the screen maybe implemented as a touch screen to receive input information from thetarget object. The touch panel includes one or a plurality of touchsensors to sense touch, wipe, and gestures on the touch panel. The touchsensors may not only sense a boundary of a touch or wipe action, butalso detect a duration and pressure associated with a touch or wipeoperation.

The audio component 710 is configured to output and/or input audio fileinformation. For example, the audio component 710 includes a microphone(MIC). When the electronic device 700 is in an operation mode, such as acall mode, a recording mode, and a voice recognition mode, themicrophone is configured to receive external audio file information. Thereceived audio file information may be further stored in the memory 704or sent via the communication component 716. In some examples, the audiocomponent 710 further includes a speaker for outputting audio fileinformation.

The I/O interface 712 provides an interface between the processingcomponent 702 and a peripheral interface module. The above-mentionedperipheral interface module may be a keyboard, a click wheel, a button,and the like.

The sensor component 714 includes one or a plurality of sensors forproviding the electronic device 700 with various aspects of stateevaluation. For example, the sensor component 714 may detect on/offstatus of the electronic device 700, or relative positioning of thecomponents, such as a display screen and a keypad of the electronicdevice 700. The sensor component 714 may also detect a position changeof the electronic device 700 or a component, presence or absence ofcontact between the target object and the electronic device 700, anorientation or acceleration/deceleration of the electronic device 700,and a temperature change of the electronic device 700. In the example,the sensor component 714 may include a magnetic sensor, a gyroscope, anda magnetic field sensor, where the magnetic field sensor includes atleast one of: a Hall sensor, a thin film magnetoresistance sensor, and amagnetic liquid acceleration sensor.

The communication component 716 is configured to facilitate wired orwireless communication between the electronic device 700 and otherdevices. The electronic device 700 may access a wireless network basedon a communication standard, such as WiFi, 2G, 3G, 4G, 5G, or acombination of them. In an example, the communication component 716receives broadcast information or broadcast-related information from anexternal broadcast management system via a broadcast channel. In anexample, the communication component 716 also includes a near fieldcommunication (NFC) module to facilitate short-range communication. Forexample, the NFC module may be implemented based on radio frequencyidentification (RFID) technology, Infrared Data Association (IrDA)technology, ultra-wideband (UWB) technology, Bluetooth (BT) technologyand other technologies.

In the example, the electronic device 700 may be implemented by one ormore of an application specific integrated circuit (ASIC), a digitalinformation processor (DSP), a digital information processing device(DSPD), a programmable logic device (PLD), a field programmable gatearray (FPGA), a controller, a microcontroller, a microprocessor or otherelectronic elements.

In an example, a non-transitory readable storage medium including anexecutable computer program is further provided, such as a memory 704including instructions. The above executable computer program may beexecuted by a processor. The readable storage medium may be a ROM, arandom access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, anoptical data storage device, etc.

After considering the specification and practicing the disclosuredisclosed herein, those of skill in the art will easily think of otherimplementations of the disclosure. The disclosure is intended to coverany variations, uses, or adaptive changes that follow the generalprinciples of the disclosure and include common knowledge orconventional technical means in the technical field that are notdisclosed in the disclosure. The specification and the examples are tobe regarded as illustrative only.

It should be understood that the disclosure is not limited to the exactconstruction that has been described above and illustrated in theaccompanying drawings, and that various modifications and changes may bemade without departing from the scope of the disclosure. It is intendedthat the scope of the disclosure only be limited by the appended claims.

What is claimed is:
 1. A method for obtaining display data, comprising:obtaining rendering data corresponding to an application programsurface; obtaining, in response to detecting an operation of adjusting adimension of the application program surface, a transformationcoefficient corresponding to the application program surface; andobtaining display data of a corresponding masking layer of theapplication program surface according to the transformation coefficientand the rendering data.
 2. The method according to claim 1, whereinobtaining the rendering data corresponding to the application programsurface comprises: obtaining surface data corresponding to theapplication program surface; obtaining the rendering data by renderingthe surface data; and storing the rendering data to a target buffer,wherein the target buffer is created upon detecting an operation oftriggering the application program surface.
 3. The method according toclaim 2, wherein the surface data comprise at least one of followingimages: a corresponding image upon detecting the operation of triggeringthe application program surface, an image pre-stored locally, or animage set in an application program.
 4. The method according to claim 1,wherein the transformation coefficient comprises at least one offollowing parameters: a scale coefficient, a rotation angle, or anoffset distance.
 5. The method according to claim 4, wherein obtainingthe transformation coefficient corresponding to the application programsurface comprises: obtaining a first dimension of an initial surfacecorresponding to an application program; obtaining a second dimension ofa target surface corresponding to the initial surface that is adjusted;and obtaining a scale value between the second dimension and the firstdimension, and setting the scale value as the transformation coefficientcorresponding to the application program surface.
 6. An electronicdevice, comprising: a processor; and a memory used to store a computerprogram executable by the processor; wherein the processor is configuredto: obtain rendering data corresponding to an application programsurface; obtain, in response to detecting an operation of adjusting adimension of the application program surface, a transformationcoefficient corresponding to the application program surface; and obtaindisplay data of a corresponding masking layer of the application programsurface according to the transformation coefficient and the renderingdata.
 7. The electronic device according to claim 6, wherein theprocessor is further configured to: obtain surface data corresponding tothe application program surface; obtain the rendering data by renderingthe surface data; and store the rendering data to a target buffer,wherein the target buffer is created upon detecting an operation oftriggering the application program surface.
 8. The electronic deviceaccording to claim 7, wherein the surface data comprise at least one offollowing images: a corresponding image upon detecting the operation oftriggering the application program surface, an image pre-stored locally,or an image set in an application program.
 9. The electronic deviceaccording to claim 6, wherein the transformation coefficient comprisesat least one of following parameters: a scale coefficient, a rotationangle, or an offset distance.
 10. The electronic device according toclaim 9, wherein the processor is further configured to: obtain a firstdimension of an initial surface corresponding to an application program;obtain a second dimension of a target surface corresponding to theinitial surface that is adjusted; and obtain a scale value between thesecond dimension and the first dimension, and set the scale value as thetransformation coefficient corresponding to the application programsurface.
 11. A non-transitory computer readable storage medium storing aplurality of programs for execution by an electronic device having oneor more processors, wherein the plurality of programs, when executed bythe one or more processors, cause the electronic device to: obtainrendering data corresponding to an application program surface; obtain,in response to detecting an operation of adjusting a dimension of theapplication program surface, a transformation coefficient correspondingto the application program surface; and obtain display data of acorresponding masking layer of the application program surface accordingto the transformation coefficient and the rendering data.
 12. Thenon-transitory computer readable storage medium according to claim 11,wherein the plurality of programs, when executed by the one or moreprocessors, cause the electronic device further to: obtain surface datacorresponding to the application program surface; obtain the renderingdata by rendering the surface data; and store the rendering data to atarget buffer, wherein the target buffer is created upon detecting anoperation of triggering the application program surface.
 13. Thenon-transitory computer readable storage medium according to claim 12,wherein the surface data comprise at least one of following images: acorresponding image upon detecting the operation of triggering theapplication program surface, an image pre-stored locally, or an imageset in an application program.
 14. The non-transitory computer readablestorage medium according to claim 11, wherein the transformationcoefficient comprises at least one of following parameters: a scalecoefficient, a rotation angle, or an offset distance.
 15. Thenon-transitory computer readable storage medium according to claim 14,wherein the plurality of programs, when executed by the one or moreprocessors, cause the electronic device further to: obtain a firstdimension of an initial surface corresponding to an application program;obtain a second dimension of a target surface corresponding to theinitial surface that is adjusted; and obtain a scale value between thesecond dimension and the first dimension, and set the scale value as thetransformation coefficient corresponding to the application programsurface.